﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
 
using System.Windows.Controls;

namespace MvvmKitDemo.ViewModels
{
    public partial class MainWindowViewModel : ViewModelBase
    {
        public MainWindowViewModel()
        {
            var vm = new JsonViewModel() { Id=1,Name="sfe",Age=18,Guid=Guid.NewGuid() };
            var json = JsonSerializer.Serialize(vm);
        }


    }

    partial class JsonViewModel : ViewModelBase
    {
        [ObservableProperty]
        public int id;

        [ObservableProperty]
        [property:JsonPropertyName("NAME")]
        public string name;
         
        [ObservableProperty]
        public int age;

        [ObservableProperty]
        [property:JsonIgnore]
        public Guid guid;
    }

    [ObservableObject]
    partial class TheModel
    {
        public int id { get; set; }
        public string name { get; set; }    
        public int age { get; set; }
    }



   

}
